package cn.actoncode.boot.framework.common.enums;

import cn.hutool.core.util.ArrayUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 平台枚举
 */
@AllArgsConstructor
@Getter
public enum PlatformEnum {

    WX(1, "微信"),
    QQ(2, "qq"),
    DOUYIN(3, "抖音"),
    WEB(4, "网页"),
    H5(5, "h5"),
    QYWX(6, "企业微信"),
    KUAISHOU(7, "快手"),
    BAIDU(8, "百度"),
    ;


    /**
     * 类型
     */
    private final Integer platform;
    /**
     * 类型名
     */
    private final String name;

    public static String getName(Integer value) {
        return ArrayUtil.firstMatch(platform -> platform.getPlatform().equals(value), PlatformEnum.values()).name;
    }

}
